!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("mode/javascript/javascript.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function a(e,t,r){return Te=e,$e=r,t}function i(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=o(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==r&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return a(r);if("="==r&&e.eat(">"))return a("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),a("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),a("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==r)return e.eat("*")?(t.tokenize=c,c(e,t)):e.eat("/")?(e.skipToEnd(),a("comment","comment")):Ie(e,t,1)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eat("="),a("operator","operator",e.current()));if("`"==r)return t.tokenize=s,s(e,t);if("#"==r)return e.skipToEnd(),a("error","error");if(Ue.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),a("operator","operator",e.current());if(We.test(r)){e.eatWhile(We);var i=e.current();if("."!=t.lastType){if(Ne.propertyIsEnumerable(i)){var u=Ne[i];return a(u.type,u.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,!1))return a("async","keyword",i)}return a("variable","variable",i)}}function o(e){return function(t,r){var n,o=!1;if(Oe&&"@"==t.peek()&&t.match(Be))return r.tokenize=i,a("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(r.tokenize=i),a("string","string")}}function c(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=i;break}n="*"==r}return a("comment","comment")}function s(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=i;break}n=!n&&"\\"==r}return a("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Se){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var a=0,i=!1,o=r-1;o>=0;--o){var c=e.string.charAt(o),s=He.indexOf(c);if(s>=0&&s<3){if(!a){++o;break}if(0==--a){"("==c&&(i=!0);break}}else if(s>=3&&s<6)++a;else if(We.test(c))i=!0;else{if(/["'\/]/.test(c))return;if(i&&!a){++o;break}}}i&&!a&&(t.fatArrowAt=o)}}function f(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function l(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function d(e,t,r,n,a){var i=e.cc;for(De.state=e,De.stream=a,De.marked=null,De.cc=i,De.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((i.length?i.pop():Pe?j:g)(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return De.marked?De.marked:"variable"==r&&l(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)De.cc.push(arguments[e])}function m(){return p.apply(null,arguments),!0}function v(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=De.state;if(De.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function k(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function y(){De.state.context={prev:De.state.context,vars:De.state.localVars},De.state.localVars=Fe}function b(){De.state.localVars=De.state.context.vars,De.state.context=De.state.context.prev}function w(e,t){var r=function(){var r=De.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new f(n,De.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function x(){var e=De.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(e){function t(r){return r==e?m():";"==e?p():m(t)}return t}function g(e,t){return"var"==e?m(w("vardef",t.length),re,h(";"),x):"keyword a"==e?m(w("form"),V,g,x):"keyword b"==e?m(w("form"),g,x):"keyword d"==e?De.stream.match(/^\s*$/,!1)?m():m(w("stat"),E,h(";"),x):"debugger"==e?m(h(";")):"{"==e?m(w("}"),F,x):";"==e?m():"if"==e?("else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==x&&De.state.cc.pop()(),m(w("form"),V,g,x,ce)):"function"==e?m(pe):"for"==e?m(w("form"),se,g,x):"class"==e||Se&&"interface"==t?(De.marked="keyword",m(w("form"),ke,x)):"variable"==e?Se&&"type"==t?(De.marked="keyword",m(Q,h("operator"),Q,h(";"))):Se&&"declare"==t?(De.marked="keyword",m(g)):Se&&("module"==t||"enum"==t)&&De.stream.match(/^\s*\w/,!1)?(De.marked="keyword",m(w("form"),ne,h("{"),w("}"),F,x,x)):Se&&"namespace"==t?(De.marked="keyword",m(w("form"),j,F,x)):m(w("stat"),W):"switch"==e?m(w("form"),V,h("{"),w("}","switch"),F,x,x):"case"==e?m(j,h(":")):"default"==e?m(h(":")):"catch"==e?m(w("form"),y,h("("),me,h(")"),g,x,b):"export"==e?m(w("stat"),xe,x):"import"==e?m(w("stat"),ge,x):"async"==e?m(g):"@"==t?m(j,g):p(w("stat"),j,h(";"),x)}function j(e,t){return A(e,t,!1)}function M(e,t){return A(e,t,!0)}function V(e){return"("!=e?p():m(w(")"),j,h(")"),x)}function A(e,t,r){if(De.state.fatArrowAt==De.stream.start){var n=r?q:C;if("("==e)return m(y,w(")"),J(me,")"),x,h("=>"),n,b);if("variable"==e)return p(y,ne,h("=>"),n,b)}var a=r?I:z;return Je.hasOwnProperty(e)?m(a):"function"==e?m(pe,a):"class"==e||Se&&"interface"==t?(De.marked="keyword",m(w("form"),ve,x)):"keyword c"==e||"async"==e?m(r?M:j):"("==e?m(w(")"),E,h(")"),x,a):"operator"==e||"spread"==e?m(r?M:j):"["==e?m(w("]"),Ee,x,a):"{"==e?D(U,"}",null,a):"quasi"==e?p(T,a):"new"==e?m(O(r)):m()}function E(e){return e.match(/[;\}\)\],]/)?p():p(j)}function z(e,t){return","==e?m(j):I(e,t,!1)}function I(e,t,r){var n=0==r?z:I,a=0==r?j:M;return"=>"==e?m(y,r?q:C,b):"operator"==e?/\+\+|--/.test(t)||Se&&"!"==t?m(n):Se&&"<"==t&&De.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?m(w(">"),J(Q,">"),x,n):"?"==t?m(j,h(":"),a):m(a):"quasi"==e?p(T,n):";"!=e?"("==e?D(M,")","call",n):"."==e?m(N,n):"["==e?m(w("]"),E,h("]"),x,n):Se&&"as"==t?(De.marked="keyword",m(Q,n)):"regexp"==e?(De.state.lastType=De.marked="operator",De.stream.backUp(De.stream.pos-De.stream.start-1),m(a)):void 0:void 0}function T(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?m(T):m(j,$)}function $(e){if("}"==e)return De.marked="string-2",De.state.tokenize=s,m(T)}function C(e){return u(De.stream,De.state),p("{"==e?g:j)}function q(e){return u(De.stream,De.state),p("{"==e?g:M)}function O(e){return function(t){return"."==t?m(e?S:P):"variable"==t&&Se?m(_,e?I:z):p(e?M:j)}}function P(e,t){if("target"==t)return De.marked="keyword",m(z)}function S(e,t){if("target"==t)return De.marked="keyword",m(I)}function W(e){return":"==e?m(x,g):p(z,h(";"),x)}function N(e){if("variable"==e)return De.marked="property",m()}function U(e,t){if("async"==e)return De.marked="property",m(U);if("variable"==e||"keyword"==De.style){if(De.marked="property","get"==t||"set"==t)return m(B);var r;return Se&&De.state.fatArrowAt==De.stream.start&&(r=De.stream.match(/^\s*:\s*/,!1))&&(De.state.fatArrowAt=De.stream.pos+r[0].length),m(H)}return"number"==e||"string"==e?(De.marked=Oe?"property":De.style+" property",m(H)):"jsonld-keyword"==e?m(H):Se&&k(t)?(De.marked="keyword",m(U)):"["==e?m(j,G,h("]"),H):"spread"==e?m(M,H):"*"==t?(De.marked="keyword",m(U)):":"==e?p(H):void 0}function B(e){return"variable"!=e?p(H):(De.marked="property",m(pe))}function H(e){return":"==e?m(M):"("==e?p(pe):void 0}function J(e,t,r){function n(a,i){if(r?r.indexOf(a)>-1:","==a){var o=De.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),m(function(r,n){return r==t||n==t?p():p(e)},n)}return a==t||i==t?m():m(h(t))}return function(r,a){return r==t||a==t?m():p(e,n)}}function D(e,t,r){for(var n=3;n<arguments.length;n++)De.cc.push(arguments[n]);return m(w(t,r),J(e,t),x)}function F(e){return"}"==e?m():p(g,F)}function G(e,t){if(Se){if(":"==e)return m(Q);if("?"==t)return m(G)}}function K(e){if(Se&&":"==e)return De.stream.match(/^\s*\w+\s+is\b/,!1)?m(j,L,Q):m(Q)}function L(e,t){if("is"==t)return De.marked="keyword",m()}function Q(e,t){return"variable"==e||"void"==t?"keyof"==t?(De.marked="keyword",m(Q)):(De.marked="type",m(Z)):"string"==e||"number"==e||"atom"==e?m(Z):"["==e?m(w("]"),J(Q,"]",","),x,Z):"{"==e?m(w("}"),J(X,"}",",;"),x,Z):"("==e?m(J(Y,")"),R):void 0}function R(e){if("=>"==e)return m(Q)}function X(e,t){return"variable"==e||"keyword"==De.style?(De.marked="property",m(X)):"?"==t?m(X):":"==e?m(Q):"["==e?m(j,G,h("]"),X):void 0}function Y(e){return"variable"==e?m(Y):":"==e?m(Q):void 0}function Z(e,t){return"<"==t?m(w(">"),J(Q,">"),x,Z):"|"==t||"."==e?m(Q):"["==e?m(h("]"),Z):"extends"==t||"implements"==t?(De.marked="keyword",m(Q)):void 0}function _(e,t){if("<"==t)return m(w(">"),J(Q,">"),x,Z)}function ee(){return p(Q,te)}function te(e,t){if("="==t)return m(Q)}function re(){return p(ne,G,ie,oe)}function ne(e,t){return Se&&k(t)?(De.marked="keyword",m(ne)):"variable"==e?(v(t),m()):"spread"==e?m(ne):"["==e?D(ne,"]"):"{"==e?D(ae,"}"):void 0}function ae(e,t){return"variable"!=e||De.stream.match(/^\s*:/,!1)?("variable"==e&&(De.marked="property"),"spread"==e?m(ne):"}"==e?p():m(h(":"),ne,ie)):(v(t),m(ie))}function ie(e,t){if("="==t)return m(M)}function oe(e){if(","==e)return m(re)}function ce(e,t){if("keyword b"==e&&"else"==t)return m(w("form","else"),g,x)}function se(e){if("("==e)return m(w(")"),ue,h(")"),x)}function ue(e){return"var"==e?m(re,h(";"),le):";"==e?m(le):"variable"==e?m(fe):p(j,h(";"),le)}function fe(e,t){return"in"==t||"of"==t?(De.marked="keyword",m(j)):m(z,le)}function le(e,t){return";"==e?m(de):"in"==t||"of"==t?(De.marked="keyword",m(j)):p(j,h(";"),de)}function de(e){")"!=e&&m(j)}function pe(e,t){return"*"==t?(De.marked="keyword",m(pe)):"variable"==e?(v(t),m(pe)):"("==e?m(y,w(")"),J(me,")"),x,K,g,b):Se&&"<"==t?m(w(">"),J(ee,">"),x,pe):void 0}function me(e,t){return"@"==t&&m(j,me),"spread"==e?m(me):Se&&k(t)?(De.marked="keyword",m(me)):p(ne,G,ie)}function ve(e,t){return"variable"==e?ke(e,t):ye(e,t)}function ke(e,t){if("variable"==e)return v(t),m(ye)}function ye(e,t){return"<"==t?m(w(">"),J(ee,">"),x,ye):"extends"==t||"implements"==t||Se&&","==e?m(Se?Q:j,ye):"{"==e?m(w("}"),be,x):void 0}function be(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||Se&&k(t))&&De.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(De.marked="keyword",m(be)):"variable"==e||"keyword"==De.style?(De.marked="property",m(Se?we:pe,be)):"["==e?m(j,G,h("]"),Se?we:pe,be):"*"==t?(De.marked="keyword",m(be)):";"==e?m(be):"}"==e?m():"@"==t?m(j,be):void 0}function we(e,t){return"?"==t?m(we):":"==e?m(Q,ie):"="==t?m(M):p(pe)}function xe(e,t){return"*"==t?(De.marked="keyword",m(Ae,h(";"))):"default"==t?(De.marked="keyword",m(j,h(";"))):"{"==e?m(J(he,"}"),Ae,h(";")):p(g)}function he(e,t){return"as"==t?(De.marked="keyword",m(h("variable"))):"variable"==e?p(M,he):void 0}function ge(e){return"string"==e?m():p(je,Me,Ae)}function je(e,t){return"{"==e?D(je,"}"):("variable"==e&&v(t),"*"==t&&(De.marked="keyword"),m(Ve))}function Me(e){if(","==e)return m(je,Me)}function Ve(e,t){if("as"==t)return De.marked="keyword",m(je)}function Ae(e,t){if("from"==t)return De.marked="keyword",m(j)}function Ee(e){return"]"==e?m():p(J(M,"]"))}function ze(e,t){return"operator"==e.lastType||","==e.lastType||Ue.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function Ie(e,t,r){return t.tokenize==i&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}var Te,$e,Ce=t.indentUnit,qe=r.statementIndent,Oe=r.jsonld,Pe=r.json||Oe,Se=r.typescript,We=r.wordCharacters||/[\w$\xa1-\uffff]/,Ne=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("keyword d"),i=e("operator"),o={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:a,break:a,continue:a,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),Ue=/[+\-*&%=<>!?|~^@]/,Be=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,He="([{}])",Je={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},Fe={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:i,lastType:"sof",cc:[],lexical:new f((e||0)-Ce,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=c&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Te?r:(t.lastType="operator"!=Te||"++"!=$e&&"--"!=$e?Te:"incdec",d(t,r,Te,$e,e))},indent:function(t,n){if(t.tokenize==c)return e.Pass;if(t.tokenize!=i)return 0;var a,o=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var f=t.cc[u];if(f==x)s=s.prev;else if(f!=ce)break}for(;("stat"==s.type||"form"==s.type)&&("}"==o||(a=t.cc[t.cc.length-1])&&(a==z||a==I)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;qe&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var l=s.type,d=o==l;return"vardef"==l?s.indented+("operator"==t.lastType||","==t.lastType?s.info+1:0):"form"==l&&"{"==o?s.indented:"form"==l?s.indented+Ce:"stat"==l?s.indented+(ze(t,n)?qe||Ce:0):"switch"!=s.info||d||0==r.doubleIndentSwitch?s.align?s.column+(d?0:1):s.indented+(d?0:Ce):s.indented+(/^(?:case|default)\b/.test(n)?Ce:2*Ce)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Pe?null:"/*",blockCommentEnd:Pe?null:"*/",blockCommentContinue:Pe?null:" * ",lineComment:Pe?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Pe?"json":"javascript",jsonldMode:Oe,jsonMode:Pe,expressionAllowed:Ie,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=j&&t!=M||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"function"==typeof e.define&&e.define("modeJs",["mode/javascript/javascript.js"],function(){})}(this);